package com.Maykk.Demo09;

/**
 * @ClassName: ProDucer
 * @Description: TODO 生产者线程类
 * @Author: MaykkStar@163.com
 */
public class Producer implements Runnable {
    private Box box;

    public Producer(Box box) {
        this.box = box;
    }

    @Override
    public void run() {
        int i;
        for (i = 1; i <= 7; i++) {
            box.put(i);
            if (i == 7) System.exit(0);
        }

    }
}